package com.giao.controller;

import com.giao.entity.Role;
import com.giao.entity.User;
import com.giao.repository.RoleRepository;
import com.giao.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RoleController {
    @Autowired
    private RoleRepository roleRepository;
    @RequestMapping("/get2")
    public List<Role> get2(){
        return (List<Role>) roleRepository.findAll();
    }
}